$(function(){
	
});

String.prototype.trim = function(){
	return this.replace(/^[\s\r\n\t]+|[\s\r\n\t]+$/g, "");
};

function flash(message, type){
	type = type ? type : "ok";
	var el = $(".flash-message");
	el.addClass(type);
	el.html(message);
	el.show();
	hideFlash();
}

function hideFlash(){
	setTimeout(function(){
		$(".flash-message").slideUp();
	}, 10000);
}
function urlize(string){
	var mask = {
		"č": "c",
		"ć": "c",
		"š": "s",
		"ž": "z",
		"đ": "dj"
	}
	string = string.toLowerCase();
	for(x in mask){
		string = string.replace(x, mask[x]);
	}
	string = string.replace(/[\s\t_\/\?\^&\*\+]/ig, "-");
	return string.replace(/-{2,}/g, "-");
}